<?php
session_start();
include_once("conf/CoreConfiguration.inc.php");
include_once("conf/CoreSetting.inc.php");

include_once("inc/importer.lib.php");
include_once("inc/application.initilialization.php");

include_once("inc/application.loader.php");

$_SESSION['Lang'] = "ID";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php
        $tApplicationTitle = APPLICATION_NAME;
        $tApplicationTitle = str_replace("<sup>", "(", $tApplicationTitle);
        $tApplicationTitle = str_replace("</sup>", ")", $tApplicationTitle);
        ?>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <title><?php echo $tApplicationTitle . " - " . APPLICATION_CLIENT ?></title>

        <?php
        foreach ($mIncStyle as $style) {
            echo $style;
        }
        ?>

        <link type="text/css" rel="stylesheet" href="lib/core/jscript/chart/visualize.jQuery.css"/>
        <link type="text/css" rel="stylesheet" href="lib/core/jscript/chart/demopage.css"/>
        <script type="text/javascript" src="lib/core/jscript/chart/jquery.min.js"></script>

<!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></script><![endif]-->
        <script type="text/javascript" src="lib/core/jscript/chart/visualize.jQuery.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $("#SettingGrafik-DefaultCheckbox").click(function(){
                    var IsDefault = $("#SettingGrafik-DefaultCheckbox").attr("checked");
                   
                    if(IsDefault == true) {
                        document.getElementById("SettingGrafik-Width").disabled= true;
                        $("#SettingGrafik-Width").addClass("Disabled");
                       
                    } else {
                        document.getElementById("SettingGrafik-Width").disabled= false;
                        $("#SettingGrafik-Width").removeClass("Disabled");
                        

                    }
                       
                }); 
            });
            
            $(function(){
                $('table').visualize();
	
                //hide table
                $('table').addClass('accessHide');
		
                $('.chartConfiguratorThingy')
                .show()
                .find('.typeOptions>.fieldGroup>input[type=radio]')
                .bind('updateDependencies',function(){
                    if($(this).is(':checked')){
                        $(this).next().next(':hidden').slideDown(function(){ $(this).find('input,select').removeAttr('disabled');  });
                    }
                    else{
                        $(this).next().next(':visible').slideUp(function(){ $(this).find('input,select').attr('disabled','disabled'); });
                    }
                })
                .trigger('updateDependencies')
                .click(function(){ $('.typeOptions>.fieldGroup>input[type=radio]').trigger('updateDependencies'); })
                .end()
                .bind('click keyup',function(){
                    var chartOptions = {};
                    var formVars = $(this).serialize();
                    $.each(formVars.split('&'),function(){
                        var thisPair = this.split('=');
                        if(thisPair[1]){ 
                            //fix non-string types
                            var thisVal = unescape(thisPair[1]);
                            //bool true
                            if(thisVal == 'true'){ thisVal = true; }
                            //bool false
                            if(thisVal == 'false'){ thisVal = false; }
                            //arrays
                            if(thisPair[0] == 'colors' || thisPair[0] == 'textColors'){
                                thisVal = thisVal.replace(/[\[\]\']/g,'').split(',');
                            }
						
                            chartOptions[thisPair[0]] = thisVal;
                        }
                    });
                    $('.visualize').remove();
                    $('table').visualize(chartOptions);
                });	
		
        });
        </script>
    </head>

    <body>
        <?php
        $myApp->PrintGraphicPage();
        ?>
    </body>
</html>